
import os



# 创建路径
def makedir(new_dir):
    if not os.path.exists(new_dir):
        os.makedirs(new_dir)

#---------------------------------------------------#
#   获得类
#---------------------------------------------------#
def get_classes(classes_path):
    with open(classes_path, encoding='utf-8') as f:
        class_names = f.readlines()
    class_names = [c.strip() for c in class_names]
    # strip()用于移除字符串头尾指定的字符(默认为空格或换行符)或字符序列
    return class_names, len(class_names)


